#include <iostream>
using namespace std;
int main(){
	int sum[5]={0},cn[5]={0};
	int max=-999999;
	int n;
	cin>>n;
	while(n--){
		int temp;
		cin>>temp;
		if(temp%5==0 && temp%2==0){
			sum[0]+=temp;
			cn[0]++;
		}
		else if(temp%5==1){
			if(cn[1]%2!=0){
				temp=(-1)*temp;
			}
			cn[1]++;
			sum[1]+=temp;
			
		}
		else if(temp%5==2){
			cn[2]++;
		}
		else if(temp%5==3){
			cn[3]++;
			sum[3]+=temp;
		}
		else if(temp%4==1){
			if(temp>max){
				max=temp;
			}
			cn[4]++;
		}
	}
	if(cn[0]==0) cout<<"N"<<endl;
	else cout<<sum[0]<<endl;
	if(cn[1]==0) cout<<"N"<<endl;
	else cout<<sum[1]<<endl;
	if(cn[2]==0) cout<<"N"<<endl;
	else cout<<cn[2]<<endl;
	if(cn[3]==0) cout<<"N"<<endl;
	else cout<<float(sum[3]/cn[3])<<endl;
	if(cn[4]==0) cout<<"N"<<endl;
	else cout<<max<<endl;
	return 0;
}
